package com.sskj.functions.presenter;


import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.functions.activity.BorrowMoneyActivity;
import com.sskj.functions.presenter.BasePresenter;
import com.sskj.lib.bean.SignInListBean;
import com.sskj.lib.bean.StrategyBean;
import com.sskj.lib.http.JsonCallBack;

/**
 * @author Hey
 * Create at  2019/06/26
 */
public class BorrowMoneyPresenter extends BasePresenter<BorrowMoneyActivity> {

    public void getBorrowData(String pay_type, String page, String type,String languages,boolean flag) {
        httpService.getStrategyData(pay_type,type,page,languages)
                .tag(this)
                .execute(new JsonCallBack<HttpData<StrategyBean>>(flag?this:null) {
                    @Override
                    public void onSuccess(Response<HttpData<StrategyBean>> response) {
                        StrategyBean data = response.body().getData();
                        mView.getStrategyDataSuccess(data);
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.onStopRefresh();
                    }
                });
    }
}
